package com.devunion.bogdan.view.actions.annotations;

import com.devunion.bogdan.util.IconHelper;
import com.devunion.bogdan.view.editors.PageEditorHelper;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
 * @author Viktar Liaskovich
 */
public class ShowHideAnnotationsAction extends AbstractAction {

    public ShowHideAnnotationsAction() {
        super(null, IconHelper.getIcon("ShowHideAnnotations16.gif"));
        putValue(Action.LARGE_ICON_KEY, IconHelper.getIcon("ShowHideAnnotations24.gif"));
    }

    public void actionPerformed(ActionEvent e) {
        PageEditorHelper.getInstance().getEditor().showAnnotations(((JToggleButton) e.getSource()).isSelected());
    }
}
